package de.game.actor.creep;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

import de.core.utils.ImageUtils;

public class TestCreep extends AbstractCreep {

    public TestCreep(int aX, int aY) {
        super(createImage(), 100, 1.0d, aX, aY);
    }

    private static BufferedImage createImage() {
        BufferedImage image = ImageUtils.createCompatibleImage(16, 16);
        Graphics graphics = image.getGraphics();
        graphics.setColor(new Color(180, 90, 180));
        graphics.fillOval(0, 0, 16, 16);
        graphics.dispose();
        return image;
    }

    @Override
    protected void act() {
        if (getLocation().getX() + 10 >= getLevel().getWidth()
            || getLocation().getX() - 10 <= 0) {
            rotate(120);
        }
        if (getLocation().getY() + 10 >= getLevel().getHeight()
            || getLocation().getY() - 10 <= 0) {
            rotate(120);
        }
    }
}
